<include file="Public/head" />
    <div class="tableContainer">
        <div class="tablePanel">
            <div class="navInfo">
                <div class="title">
                    <span class="title-icon14"></span>
                    <div><span>&nbsp;&nbsp;<{$module_name_zh}>列表</span></div>
                </div>
                <form method="get" action="<{:U('')}>">
                    <input type="hidden" name="m" value="<{:MODULE_NAME}>" />
                    <input type="hidden" name="c" value="<{:CONTROLLER_NAME}>" />
                    <input type="hidden" name="a" value="<{:ACTION_NAME}>" />
                    <div class="searchWrapper">
                        <select name="num" class="searchItem">
                            <option value="">赞数排序</option>
                            <option value="desc" <{:I('num') == 'desc' ? 'selected' : ''}>>按赞数递减</option>
                            <option value="asc" <{:I('num') == 'asc' ? 'selected' : ''}>>按赞数递增</option>
                        </select>&nbsp;
                        <select name="create_time" class="searchItem">
                            <option value="">上传时间排序</option>
                            <option value="desc" <{:I('create_time') == 'desc' ? 'selected' : ''}>>按上传时间递减</option>
                            <option value="asc" <{:I('create_time') == 'asc' ? 'selected' : ''}>>按上传时间递增</option>
                        </select>&nbsp;
                        <input type="text" name="keywords" value="<{:I('keywords')}>" class="searchItem" placeholder="请输入照片编号" />&nbsp;
                        <input type="submit" class="button addBtn" value="查询">&nbsp;
                        <a href="<{:U('output')}>" target="_blank"><input type="button" class="button addBtn" value="导出" /></a>
                    </div>
                </form>
            </div>
            <div class="tableContent">
                <div class="list0">
                    <table cellspacing="0" cellpadding="0">
                        <!-- 默认每列的宽度相等，如需调整某列宽度，只需加width属性 -->
                        <thead>
                            <tr class="thWrapper">
                                <th class="titleFirst"></th><th width="50">ID</th>
                                <th class="sepTh"><div></div></th><th width="50">排名</th>
                                <th class="sepTh"><div></div></th><th width="80">赞数</th>
                                <th class="sepTh"><div></div></th><th>照片</th>
                                <th class="sepTh"><div></div></th><th>昵称</th>
                                <th class="sepTh"><div></div></th><th>手机号</th>
                                <th class="sepTh"><div></div></th><th>卡号</th>
                                <th class="sepTh"><div></div></th><th>会员编号</th>
                                <th class="sepTh"><div></div></th><th>上传时间</th>
                                <th class="sepTh"><div></div></th><th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            <foreach name="list" item="vo">
                                <tr class="tdWrapper">
                                    <td></td><td><{$vo.id}></td>
                                    <td class="sepTd"></td><td><{$vo.index}></td>
                                    <td class="sepTd"></td><td style="font-weight:bold;"><{$vo.num}></td>
                                    <td class="sepTd"></td><td style="padding:5px 0 0 5px;"><img src="<{:C('IMG_PREFIX').$vo['pic']}>" max-width="100" height="60" /></td>
                                    <td class="sepTd"></td><td><{$vo['WxMember']['nickname']|default='--'}></td>
                                    <td class="sepTd"></td><td><{$vo['WxMember']['phone']|default='--'}></td>
                                    <td class="sepTd"></td><td><{$vo['WxMember']['card_num']|default='--'}></td>
                                    <td class="sepTd"></td><td><{$vo['WxMember']['member_num']|default='--'}></td>
                                    <td class="sepTd"></td><td><{:substr($vo['create_time'], 2, 14)}></td>
                                    <td class="sepTd"></td>
                                    <td>
                                        <a href="javascript:void(0);" onclick="editNum('<{$vo.id}>', '<{$vo.num}>')">修改赞数</a>
                                        &nbsp;|&nbsp;
                                        <a href="javascript:void(0);" onclick="delRow('<{$vo.id}>',this)" id="delBtn<{$vo.id}>">删除</a>
                                    </td>
                                </tr>
                            </foreach>
                        </tbody>
                    </table>
                </div>
                <!-- 分页 -->
                <div class="page-list">
                    <div class="page-list"><{$page}></div>
                </div>
            </div>
        </div>
    </div>
    <!-- layer的prompt层 -->
    <script type='text/javascript' src='__PUBLIC__/layer/extend/layer.ext.js'></script>
    <script>
        layer.config({
            extend: 'extend/layer.ext.js'
        });
        function editNum(id, num){
            layer.prompt({
                title: '输 入 新 的 数 值',
                value: num
            }, function(pass){
                if (!isAdminNumber(pass)) {
                    alert('请输入数值');return;
                }

                $.post("<{:U('editNum')}>", {id: id, num: pass}, function(res) {
                    layer.msg(res.info);
                    if (res.status == 1) setTimeout('location.reload()',1200);
                }, 'json');
            });
        }

        //状态删除
        function delRow(id,obj){
            if(confirm('确定要删除吗？')){
                $.post("<{:U('del')}>",{id:id},function(res){
                    if(res.status == 1){
                        note_info(res.info,obj);
                        setTimeout('location.reload()',1200);
                    }else{
                        note_info(res.info,obj,'warn');
                    }
                },'json');
            }
        }
    </script>
<include file="Public/foot" />